import Vue from 'vue'
import App from './App.vue'
import router from './router'
import '@/permission' // permission control
import store from './store'
import 'normalize.css/normalize.css'
import Element from 'element-ui'
import './styles/element-variables.scss'
import 'xe-utils'
import i18n from '@/i18n'
import VXETable from 'vxe-table'
import 'vxe-table/lib/style.css'
import Katex from '@/common/katex'
import VueParticles from 'vue-particles'
import Message from 'vue-m-message'
import SlideVerify from 'vue-monoplasty-slide-verify'
import VueClipboard from 'vue-clipboard2'
import Md_Katex from '@iktakahiro/markdown-it-katex'
import highlight from '@/common/highlight'
import ElementLocale from 'element-ui/lib/locale'
import filters from '@/common/filters.js'

import '@/styles/index.scss' // global css
import './icons' // icon
import NProgress from 'nprogress' // progress bar
import 'nprogress/nprogress.css' // progress bar style

//  markdown编辑器
import mavonEditor from 'mavon-editor'  //引入markdown编辑器
import 'mavon-editor/dist/css/index.css';
Vue.use(mavonEditor)


Vue.config.productionTip = false

NProgress.configure({ showSpinner: false }) // NProgress Configuration


Object.keys(filters).forEach(key => {   // 注册全局过滤器
  Vue.filter(key, filters[key])
})
Vue.use(VueParticles) // 粒子特效背景
Vue.use(Katex)  // 数学公式渲染

VXETable.setup({
  // 对组件内置的提示语进行国际化翻译
  i18n: (key, value) => i18n.t(key, value)
})
Vue.use(VXETable) // 表格组件
Vue.use(VueClipboard) // 剪贴板
Vue.use(highlight) // 代码高亮

Vue.use(Element,{
  i18n: (key, value) => i18n.t(key, value)
})
Vue.use(Message, {name: 'msg'}) // `Vue.prototype.$msg` 全局消息提示
ElementLocale.i18n((key, value) => i18n.t(key, value))

Vue.prototype.$$router = router

// Vue.prototype.$markDown = mavonEditor.mavonEditor.getMarkdownIt().use(Md_Katex)  // 挂载到vue
new Vue({
  router: router,
  store: store,
  i18n,
  render: h => h(App)
}).$mount('#app')
